<?php
$sql['get_info_dosen']="
  SELECT 
  	dsnId AS DOSEN_ID,
  	ifnull(dsnNama,'n/a') AS DOSEN_NAMA,
  	ifnull(dsnAlamatRumah,'n/a') AS DOSEN_ALAMAT_RUMAH,
  	ifnull(dsnAlamatKantor,'n/a') AS DOSEN_ALAMAT_KANTOR,
  	ifnull(dsnNoTelp,'n/a') AS DOSEN_NO_TELP,
  	ifnull(dsnEmail,'n/a') AS DOSEN_EMAIL
  FROM u_dosen
  WHERE 
  	dsnUldId='%s';
";
$sql['get_list_mahasiswa']="
  SELECT 
  concat(mhsNama,' (',IF(ulgIsLogin=1,'Online','Offline'),')') AS label,
  	mhsId AS data
  FROM u_mahasiswa
	LEFT JOIN r_dosen_bimbingan ON mhsId=dsnbimMhsId
	LEFT JOIN u_user_login ON mhsUlgId=ulgId
  WHERE dsnbimDsnId='%s';
";

$sql['get_pengumuman']="
  SELECT 
  	pengId AS PENG_ID,
  	pengJudul AS PENG_JUDUL,
  	pengDsn AS PENG_DOSEN,
  	pengTanggal AS PENG_TANGGAL,
  	pengIsi AS PENG_ISI
  FROM u_pengumunan
   WHERE pengDsn='%s';
";

$sql['do_update_dosen']="
  UPDATE u_dosen 
  SET
  	dsnNama='%s',
  	dsnAlamatRumah='%s',
  	dsnAlamatKantor='%s',
  	dsnNoTelp='%s',
  	dsnEmail='%s'
  WHERE 
  	dsnId='%s';
";

$sql['do_add_pengumuman']="
  INSERT u_pengumunan 
  SET 
    pengJudul='%s',
    pengDsn='%s',
    pengTanggal=NOW(),
    pengIsi='%s';
";
$sql['do_update_pengumunan']="
  UPDATE u_pengumunan
  SET 
    pengJudul='%s',
    pengDsn='%s',
    pengTanggal=NOW(),
    pengIsi='%s'
  WHERE pengId='%s';
";
?>
